package org.ifilm.service;

import java.util.List;

import org.ifilm.dao.UtilDao;
import org.ifilm.model.City;
import org.ifilm.model.Country;
import org.ifilm.model.Language;
import org.ifilm.model.TipsAndTricks;
import org.ifilm.model.UserType;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * 
 * @author Mustafa Genç
 *
 */
@Service
@Transactional
public class UtilServiceImpl implements UtilService {
	
	@Autowired
	private UtilDao utilDao;

	@Override
	public List<Country> listCountries() {
		return utilDao.listCountries();
	}

	@Override
	public List<City> getCitiesByCountry(Long countryId) {
		return utilDao.getCitiesByCountry(countryId);
	}

	@Override
	public List<UserType> getUserTypes() {
		return utilDao.getUserTypes();
	}
	
	@Override
	public List<Language> getLanguages() {
		return utilDao.getLanguages();
	}

	@Override
	public List<Object> getSearchable(Integer page, Integer max, String searchText) {
		return utilDao.getSearchable(page, max, searchText);
	}
	
	@Override
	public TipsAndTricks createTipAndTrick(TipsAndTricks tipAndTrick) {
		return utilDao.createTipAndTrick(tipAndTrick);
	}

	@Override
	public List<TipsAndTricks> getTipsByUser(Long userid) {
		return utilDao.getTipsByUser(userid);
	}

	@Override
	public List<TipsAndTricks> getTipsByType(int type) {
		return utilDao.getTipsByType(type);
	}

	@Override
	public List<TipsAndTricks> getTipsBySubject(String subject) {
		return utilDao.getTipsBySubject(subject);
	}

	@Override
	public List<TipsAndTricks> getAllTips() {
		return utilDao.getAllTips();
	}
}